#include <AVUITransform.h>
#include <AVUITransform3DCollection.h>

namespace AVUI {

class GeneralTransform3DGroup : public GeneralTransform3D
{
public:
    GeneralTransform3DGroup() { };
    ~GeneralTransform3DGroup() { m_children.InvalidateWeakReferences(); }


    DECLARE_ELEMENT(GeneralTransform3DGroup, GeneralTransform3D);
    IMPLEMENT_READONLY_REFERENCE_PROPERTY(Children, GeneralTransform3DCollection, true);

    GeneralTransform3DCollection* get_Children() { return &m_children; }

    virtual void CloneCore(Freezable* pSource);

    bool get_IsAffine();

    virtual Rect3D TransformBounds(const Rect3D& rect) AVUI_OVERRIDE;
    virtual bool TryTransform(const Point3D& inPoint, Point3D* pResult) AVUI_OVERRIDE;

    virtual TRefCountedPtr<GeneralTransform3D> get_Inverse() AVUI_OVERRIDE;
    virtual TRefCountedPtr<Transform3D> get_AffineTransform() AVUI_OVERRIDE;

protected:

    virtual TRefCountedPtr<Freezable> CreateInstanceCore() AVUI_OVERRIDE { return object_allocate<GeneralTransform3DCollection>().get_Ptr(); }

private:
    GeneralTransform3DCollection m_children;
};

typedef TRefCountedPtr<GeneralTransform3DGroup> GeneralTransform3DGroupPtr;


}; // namespace AVUI
